[fix][cpp-client] Pass seek error to callback when SEEK command fails#549
Open
zhanglistar wants to merge 7 commits intoapache:mainfrom
Open
[fix][cpp-client] Pass seek error to callback when SEEK command fails#549zhanglistar wants to merge 7 commits intoapache:mainfrom
zhanglistar wants to merge 7 commits intoapache:mainfrom
Conversation
BewareMyPower
requested changes
Mar 16, 2026
added 2 commits
March 17, 2026 09:28
BewareMyPower
requested changes
Mar 17, 2026
added 2 commits
March 21, 2026 21:28
Comment on lines
+1849
to
+1850
| executor_->postWork([self, callback{std::exchange(seekCallback_, std::nullopt).value()}, | ||
| result]() { callback(result); }); |
Contributor
There was a problem hiding this comment.
It seems that this PR is no longer fixing testHasMessageAvailableAfterSeekToEnd but just to propagate the correct error from seek response. Could you update the PR title?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #528
Motivation
In
ConsumerImpl::seekAsyncInternal, when the broker responds to the SEEK request with a non-OKresult, we reset seek state and invoke the userseekCallback_on the executor. The failure path incorrectly calledcallback(ResultOk), so callers could observe success even though the seek had failed.Modifications
result != ResultOkbranch of the SEEK response handler, change the posted callback fromcallback(ResultOk)tocallback(result)(captureresultin the lambda and forward the actual error code).Verifying this change
Seek failure is now surfaced with the correct
Resultcode toseekAsync/ synchronousseekcallers.Documentation
doc-not-neededInternal bug fix; no API or user-facing behavior contract change beyond reporting the correct error on seek failure.